package com.lvmama.controller.rhino.position;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;
import com.lvmama.client.rhino.PositionAnalysisClient;
import com.lvmama.common.result.Result;
import com.lvmama.pojo.entity.rhino.topic.PositionAnalysis;

/**
 * @param
 * @Title:
 * @Author:wangpeng
 * @Description: TODO(这里用一句话描述这个方法的作用)
 * @return
 * @throws
 */
@Controller
@RequestMapping(value = "/positionAnalysis")
public class PositionAnalysisController {

	@Autowired
	PositionAnalysisClient client;

	/**
	 * 坑位分析页面
	 * @return
	 */
	@RequestMapping(value = "positionTree",method = RequestMethod.GET)
	public String topicTree() {
		return "rhino/position/positionTree";
	}

	/**
	 * @Title: queryList
	 * @Description: 坑位列表
	 * @throws
	 */
	@RequestMapping(value = "queryList",method = RequestMethod.POST)
	@ResponseBody
	public Result<PageInfo<PositionAnalysis>> queryList(PositionAnalysis dto){
		return client.queryList(dto);
	}
	/**
	 * 图表数据
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "chartData",method = RequestMethod.GET)
	@ResponseBody
	public Map<String, Object> chartData(PositionAnalysis dto){
		return client.chartData(dto).getData();
	}
	/**
	 * @Title: getPageChartData
	 * @Description: 根据品类获取相关页面的引流
	 * @return Map<String,Object> 返回类型
	 * @throws
	 */
	@RequestMapping(value = "getPageChartData",method = RequestMethod.GET)
	@ResponseBody
	public Map<String, Object> getPageChartData(PositionAnalysis dto) {
		return client.getPageChartData(dto).getData();
	}

	@RequestMapping(value = "queryDetailByCode",method = RequestMethod.GET)
	@ResponseBody
	public List<PositionAnalysis> queryDetailByCode(PositionAnalysis dto){
		return client.queryDetailByCode(dto).getData();
	}
}
